{include title="欢迎登录" keywords="" description=""  file='../application/admin/view/layout/header.html' /}
<header>

</header>
<body class="login-bg">
<div class="login layui-anim layui-anim-up">
    <div class="message">x-admin2.0-管理登录</div>
    <div id="darkbannerwrap"></div>

    <form action="{:url('admin/login/index')}" class="layui-form" >
        {:token()}

        <input name="username" placeholder="用户名"  type="text" class="layui-input" >

        <hr class="hr15">
        <input name="password" placeholder="密码"  type="password" class="layui-input">

<!--        <hr class="hr15">-->
<!--        <input style="width: 150px;float: left;" name="captcha" placeholder="验证码" class="layui-input">-->
<!--        <img style="width: 120px;height: 38px; margin-left: 20px;" src="{:url('admin/login/getCaptcha')}"  onclick="this.src='{:url(\'admin/login/getCaptcha\')}?d='+Math.random();">-->

        <hr class="hr15">
        <input type="checkbox" name="online" value="1" lay-skin="primary" title="使我保持登录状态">

        <hr class="hr15">
        <input value="登录" class="a" style="width:100%;" type="submit">
        <hr class="hr20" >
    </form>
</div>

<script>
    $(function  () {
        layui.use('layer', function () {
            layer = layui.layer;
        });

        //新增
        var check = $("form").Validform({
            tiptype: function (msg, o) {
                if (o.type == 3) {
                    layer.msg(msg, {icon: 2,offset: '60%'});
                }
            },
            ajaxPost: true,
            callback: function (data) {
                if (data.status == 'y') {
                    layer.msg(data.info, {icon: 1});
                    setTimeout(function () {
                        location.href = "{:url('admin/index/index')}";
                    }, 1000);
                } else {
                    $("[name=__token__]").val(data.token);
                }
            }
        });
        // check.addRule([
        //     {ele: "[name='username']", datatype: /^\w{4,18}$/, nullmsg: '请填写用户名', errormsg: "用户名在4至18位之间的数字、字母、下划线"},
        //     {ele: "[name='password']", datatype: /[a-z\d#@!~%^&*]{6,18}/i, nullmsg: '请填写密码', errormsg: "密码在6到18位之间的数字、字母、英文符号"},
        //     {ele: "[name='captcha']", datatype: /^[a-zA-Z0-9]{4}$/, nullmsg: '请输入验证码', errormsg: "验证码为4位数字字母"}
        // ]);
    });
</script>
<!-- 底部结束 -->
</body>
</html>